#include "qmath.h"
#include <math.h>

static const float sin_vals[1024];
static const float tan_vals[1024];

static uint16_t binary_search(const float *sorted_arrray, uint16_t array_length, float target);

float qsin(float x)
{
	float sign;
	uint64_t idx;
	
	if(x<0)
	{
		sign = -1.0;
		x = -x;
	}
	else
	{
		sign = 1.0;
	}
	
	idx	= (uint32_t)(x * 651.89864690440329530934789477382 + 0.5); // 651.899 = 1024 / (0.5*PI)
	idx = idx - ((idx >> 12) << 12); // 对4096取余
	
	if(idx < 1024) // 0 ~ PI/2
	{
		return sign * sin_vals[idx];
	}
	else if(idx < 2048) // PI/2 ~ PI
	{
		return sign * sin_vals[2047-idx];
	}
	else if(idx < 3072)
	{
		return -sign * sin_vals[idx-2048];
	}
	else
	{
		return -sign * sin_vals[4095-idx];
	}
}

float qcos(float x)
{
	uint64_t idx = (uint64_t)(fabsf(x) * 651.89864690440329530934789477382 + 0.5);
	idx = idx + 1024;
	idx = idx - ((idx >> 12) << 12); // 对4096取余
	
	if(idx < 1024) // 0 ~ PI/2
	{
		return sin_vals[idx];
	}
	else if(idx < 2048) // PI/2 ~ PI
	{
		return sin_vals[2047-idx];
	}
	else if(idx < 3072)
	{
		return -sin_vals[idx-2048];
	}
	else
	{
		return -sin_vals[4095-idx];
	}
}

float qtan(float x)
{
	float sign;
	uint64_t idx;
	
	if(x<0)
	{
		sign = -1.0;
		x = -x;
	}
	else
	{
		sign = 1.0;
	}
	
	idx	= (uint64_t)(x * 651.89864690440329530934789477382 + 0.5);
	idx = idx - ((idx >> 12) << 12); // 对4096取余
	
	if(idx < 1024) // 0 ~ PI/2
	{
		return sign * tan_vals[idx];
	}
	else if(idx < 2048) // PI/2 ~ PI
	{
		return -sign * tan_vals[2047-idx];
	}
	else if(idx < 3072)
	{
		return sign * tan_vals[idx-2048];
	}
	else
	{
		return -sign * tan_vals[4095 - idx];
	}
}

float qasin(float x)
{
	// -pi/2 ~ pi / 2
	float sign;
	
	if(x<0)
	{
		sign = -1.0;
		x = -x;
	}
	else
	{
		sign = 1.0;
	}
	
	uint16_t idx = binary_search(sin_vals,1024,x);
	
	return sign * idx * 0.00153398078788564122971808758949;
}

float qacos(float x)
{
	return -qasin(x) + 1.5707963267948966192313216916398;
}

float qatan(float x)
{
		// -pi/2 ~ pi / 2
	float sign;
	
	if(x<0)
	{
		sign = -1.0;
		x = -x;
	}
	else
	{
		sign = 1.0;
	}
	
	uint16_t idx = binary_search(tan_vals,1024,x);
	
	return sign * idx * 0.00153398078788564122971808758949;
}

float qatan2(float y, float x)
{
	if(x == 0)
	{
		if(y>=0) return 1.5707963267948966192313216916398; // PI/2
		if(y<0) return -1.5707963267948966192313216916398;
	}
	
	float angle =  qatan(y/x);
	
	if(x < 0)
	{
		if(y > 0)
		{
			angle = angle + 3.1415926535897932384626433832795;
		}
		else if(y < 0)
		{
			angle = angle - 3.1415926535897932384626433832795;
		}
		else // y=0,x<0
		{
			angle = - 3.1415926535897932384626433832795;
		}
	}
	
	return angle;
}

static uint16_t binary_search(const float *sorted_arrray, uint16_t array_length, float target)
{
	uint16_t low, mid, high;
	
	low = 0;
	high = array_length - 1;
	
	while(low <= high)
	{
		mid = low + (high - low) / 2;
		
		// 如果目标值在左半部分，缩小搜索范围至左半部分
		if (sorted_arrray[mid] > target) 
		{
			high = mid - 1;
		}
		// 如果目标值在右半部分，缩小搜索范围至右半部分
		else if(sorted_arrray[mid] < target)
		{
			low = mid + 1;
		}
		else
		{
			return mid;
		}
	}
	
	return mid;
}

static const float sin_vals[] = {
	0.000000, 0.001534, 0.003068, 0.004602, 0.006136, 0.007670, 0.009204, 0.010738, 0.012272, 0.013805, 0.015339, 0.016873, 0.018407, 0.019940, 0.021474, 0.023008, 
	0.024541, 0.026075, 0.027608, 0.029142, 0.030675, 0.032208, 0.033741, 0.035274, 0.036807, 0.038340, 0.039873, 0.041406, 0.042938, 0.044471, 0.046003, 0.047535, 
	0.049068, 0.050600, 0.052132, 0.053664, 0.055195, 0.056727, 0.058258, 0.059790, 0.061321, 0.062852, 0.064383, 0.065913, 0.067444, 0.068974, 0.070505, 0.072035, 
	0.073565, 0.075094, 0.076624, 0.078153, 0.079682, 0.081211, 0.082740, 0.084269, 0.085797, 0.087326, 0.088854, 0.090381, 0.091909, 0.093436, 0.094963, 0.096490, 
	0.098017, 0.099544, 0.101070, 0.102596, 0.104122, 0.105647, 0.107172, 0.108697, 0.110222, 0.111747, 0.113271, 0.114795, 0.116319, 0.117842, 0.119365, 0.120888, 
	0.122411, 0.123933, 0.125455, 0.126977, 0.128498, 0.130019, 0.131540, 0.133061, 0.134581, 0.136101, 0.137620, 0.139139, 0.140658, 0.142177, 0.143695, 0.145213, 
	0.146730, 0.148248, 0.149765, 0.151281, 0.152797, 0.154313, 0.155828, 0.157343, 0.158858, 0.160372, 0.161886, 0.163400, 0.164913, 0.166426, 0.167938, 0.169450, 
	0.170962, 0.172473, 0.173984, 0.175494, 0.177004, 0.178514, 0.180023, 0.181532, 0.183040, 0.184548, 0.186055, 0.187562, 0.189069, 0.190575, 0.192080, 0.193586, 
	0.195090, 0.196595, 0.198098, 0.199602, 0.201105, 0.202607, 0.204109, 0.205610, 0.207111, 0.208612, 0.210112, 0.211611, 0.213110, 0.214609, 0.216107, 0.217604, 
	0.219101, 0.220598, 0.222094, 0.223589, 0.225084, 0.226578, 0.228072, 0.229565, 0.231058, 0.232550, 0.234042, 0.235533, 0.237024, 0.238514, 0.240003, 0.241492, 
	0.242980, 0.244468, 0.245955, 0.247442, 0.248928, 0.250413, 0.251898, 0.253382, 0.254866, 0.256349, 0.257831, 0.259313, 0.260794, 0.262275, 0.263755, 0.265234, 
	0.266713, 0.268191, 0.269668, 0.271145, 0.272621, 0.274097, 0.275572, 0.277046, 0.278520, 0.279993, 0.281465, 0.282937, 0.284408, 0.285878, 0.287347, 0.288816, 
	0.290285, 0.291752, 0.293219, 0.294685, 0.296151, 0.297616, 0.299080, 0.300543, 0.302006, 0.303468, 0.304929, 0.306390, 0.307850, 0.309309, 0.310767, 0.312225, 
	0.313682, 0.315138, 0.316593, 0.318048, 0.319502, 0.320955, 0.322408, 0.323859, 0.325310, 0.326760, 0.328210, 0.329658, 0.331106, 0.332553, 0.334000, 0.335445, 
	0.336890, 0.338334, 0.339777, 0.341219, 0.342661, 0.344101, 0.345541, 0.346980, 0.348419, 0.349856, 0.351293, 0.352729, 0.354164, 0.355598, 0.357031, 0.358463, 
	0.359895, 0.361326, 0.362756, 0.364185, 0.365613, 0.367040, 0.368467, 0.369892, 0.371317, 0.372741, 0.374164, 0.375586, 0.377007, 0.378428, 0.379847, 0.381266, 
	0.382683, 0.384100, 0.385516, 0.386931, 0.388345, 0.389758, 0.391170, 0.392582, 0.393992, 0.395401, 0.396810, 0.398218, 0.399624, 0.401030, 0.402435, 0.403838, 
	0.405241, 0.406643, 0.408044, 0.409444, 0.410843, 0.412241, 0.413638, 0.415034, 0.416430, 0.417824, 0.419217, 0.420609, 0.422000, 0.423390, 0.424780, 0.426168, 
	0.427555, 0.428941, 0.430326, 0.431711, 0.433094, 0.434476, 0.435857, 0.437237, 0.438616, 0.439994, 0.441371, 0.442747, 0.444122, 0.445496, 0.446869, 0.448241, 
	0.449611, 0.450981, 0.452350, 0.453717, 0.455084, 0.456449, 0.457813, 0.459177, 0.460539, 0.461900, 0.463260, 0.464619, 0.465976, 0.467333, 0.468689, 0.470043, 
	0.471397, 0.472749, 0.474100, 0.475450, 0.476799, 0.478147, 0.479494, 0.480839, 0.482184, 0.483527, 0.484869, 0.486210, 0.487550, 0.488889, 0.490226, 0.491563, 
	0.492898, 0.494232, 0.495565, 0.496897, 0.498228, 0.499557, 0.500885, 0.502212, 0.503538, 0.504863, 0.506187, 0.507509, 0.508830, 0.510150, 0.511469, 0.512786, 
	0.514103, 0.515418, 0.516732, 0.518045, 0.519356, 0.520666, 0.521975, 0.523283, 0.524590, 0.525895, 0.527199, 0.528502, 0.529804, 0.531104, 0.532403, 0.533701, 
	0.534998, 0.536293, 0.537587, 0.538880, 0.540171, 0.541462, 0.542751, 0.544039, 0.545325, 0.546610, 0.547894, 0.549177, 0.550458, 0.551738, 0.553017, 0.554294, 
	0.555570, 0.556845, 0.558119, 0.559391, 0.560662, 0.561931, 0.563199, 0.564466, 0.565732, 0.566996, 0.568259, 0.569521, 0.570781, 0.572040, 0.573297, 0.574553, 
	0.575808, 0.577062, 0.578314, 0.579565, 0.580814, 0.582062, 0.583309, 0.584554, 0.585798, 0.587040, 0.588282, 0.589521, 0.590760, 0.591997, 0.593232, 0.594466, 
	0.595699, 0.596931, 0.598161, 0.599389, 0.600616, 0.601842, 0.603067, 0.604290, 0.605511, 0.606731, 0.607950, 0.609167, 0.610383, 0.611597, 0.612810, 0.614022, 
	0.615232, 0.616440, 0.617647, 0.618853, 0.620057, 0.621260, 0.622461, 0.623661, 0.624859, 0.626056, 0.627252, 0.628446, 0.629638, 0.630829, 0.632019, 0.633207, 
	0.634393, 0.635578, 0.636762, 0.637944, 0.639124, 0.640303, 0.641481, 0.642657, 0.643832, 0.645005, 0.646176, 0.647346, 0.648514, 0.649681, 0.650847, 0.652011, 
	0.653173, 0.654334, 0.655493, 0.656651, 0.657807, 0.658961, 0.660114, 0.661266, 0.662416, 0.663564, 0.664711, 0.665856, 0.667000, 0.668142, 0.669283, 0.670422, 
	0.671559, 0.672695, 0.673829, 0.674962, 0.676093, 0.677222, 0.678350, 0.679476, 0.680601, 0.681724, 0.682846, 0.683965, 0.685084, 0.686200, 0.687315, 0.688429, 
	0.689541, 0.690651, 0.691759, 0.692866, 0.693971, 0.695075, 0.696177, 0.697278, 0.698376, 0.699473, 0.700569, 0.701663, 0.702755, 0.703845, 0.704934, 0.706021, 
	0.707107, 0.708191, 0.709273, 0.710353, 0.711432, 0.712509, 0.713585, 0.714659, 0.715731, 0.716801, 0.717870, 0.718937, 0.720003, 0.721066, 0.722128, 0.723188, 
	0.724247, 0.725304, 0.726359, 0.727413, 0.728464, 0.729514, 0.730563, 0.731609, 0.732654, 0.733697, 0.734739, 0.735779, 0.736817, 0.737853, 0.738887, 0.739920, 
	0.740951, 0.741980, 0.743008, 0.744034, 0.745058, 0.746080, 0.747101, 0.748119, 0.749136, 0.750152, 0.751165, 0.752177, 0.753187, 0.754195, 0.755201, 0.756206, 
	0.757209, 0.758210, 0.759209, 0.760207, 0.761202, 0.762196, 0.763188, 0.764179, 0.765167, 0.766154, 0.767139, 0.768122, 0.769103, 0.770083, 0.771061, 0.772036, 
	0.773010, 0.773983, 0.774953, 0.775922, 0.776888, 0.777853, 0.778817, 0.779778, 0.780737, 0.781695, 0.782651, 0.783605, 0.784557, 0.785507, 0.786455, 0.787402, 
	0.788346, 0.789289, 0.790230, 0.791169, 0.792107, 0.793042, 0.793975, 0.794907, 0.795837, 0.796765, 0.797691, 0.798615, 0.799537, 0.800458, 0.801376, 0.802293, 
	0.803208, 0.804120, 0.805031, 0.805940, 0.806848, 0.807753, 0.808656, 0.809558, 0.810457, 0.811355, 0.812251, 0.813144, 0.814036, 0.814926, 0.815814, 0.816701, 
	0.817585, 0.818467, 0.819348, 0.820226, 0.821103, 0.821977, 0.822850, 0.823721, 0.824589, 0.825456, 0.826321, 0.827184, 0.828045, 0.828904, 0.829761, 0.830616, 
	0.831470, 0.832321, 0.833170, 0.834018, 0.834863, 0.835706, 0.836548, 0.837387, 0.838225, 0.839060, 0.839894, 0.840725, 0.841555, 0.842383, 0.843208, 0.844032, 
	0.844854, 0.845673, 0.846491, 0.847307, 0.848120, 0.848932, 0.849742, 0.850549, 0.851355, 0.852159, 0.852961, 0.853760, 0.854558, 0.855354, 0.856147, 0.856939, 
	0.857729, 0.858516, 0.859302, 0.860085, 0.860867, 0.861646, 0.862424, 0.863199, 0.863973, 0.864744, 0.865514, 0.866281, 0.867046, 0.867809, 0.868571, 0.869330, 
	0.870087, 0.870842, 0.871595, 0.872346, 0.873095, 0.873842, 0.874587, 0.875329, 0.876070, 0.876809, 0.877545, 0.878280, 0.879012, 0.879743, 0.880471, 0.881197, 
	0.881921, 0.882643, 0.883363, 0.884081, 0.884797, 0.885511, 0.886223, 0.886932, 0.887640, 0.888345, 0.889048, 0.889750, 0.890449, 0.891146, 0.891841, 0.892534, 
	0.893224, 0.893913, 0.894599, 0.895284, 0.895966, 0.896646, 0.897325, 0.898001, 0.898674, 0.899346, 0.900016, 0.900683, 0.901349, 0.902012, 0.902673, 0.903332, 
	0.903989, 0.904644, 0.905297, 0.905947, 0.906596, 0.907242, 0.907886, 0.908528, 0.909168, 0.909806, 0.910441, 0.911075, 0.911706, 0.912335, 0.912962, 0.913587, 
	0.914210, 0.914830, 0.915449, 0.916065, 0.916679, 0.917291, 0.917901, 0.918508, 0.919114, 0.919717, 0.920318, 0.920917, 0.921514, 0.922109, 0.922701, 0.923291, 
	0.923880, 0.924465, 0.925049, 0.925631, 0.926210, 0.926787, 0.927363, 0.927935, 0.928506, 0.929075, 0.929641, 0.930205, 0.930767, 0.931327, 0.931884, 0.932440, 
	0.932993, 0.933544, 0.934093, 0.934639, 0.935184, 0.935726, 0.936266, 0.936803, 0.937339, 0.937872, 0.938404, 0.938932, 0.939459, 0.939984, 0.940506, 0.941026, 
	0.941544, 0.942060, 0.942573, 0.943084, 0.943593, 0.944100, 0.944605, 0.945107, 0.945607, 0.946105, 0.946601, 0.947094, 0.947586, 0.948075, 0.948561, 0.949046, 
	0.949528, 0.950008, 0.950486, 0.950962, 0.951435, 0.951906, 0.952375, 0.952842, 0.953306, 0.953768, 0.954228, 0.954686, 0.955141, 0.955594, 0.956045, 0.956494, 
	0.956940, 0.957385, 0.957826, 0.958266, 0.958703, 0.959139, 0.959572, 0.960002, 0.960431, 0.960857, 0.961280, 0.961702, 0.962121, 0.962538, 0.962953, 0.963366, 
	0.963776, 0.964184, 0.964590, 0.964993, 0.965394, 0.965793, 0.966190, 0.966584, 0.966976, 0.967366, 0.967754, 0.968139, 0.968522, 0.968903, 0.969281, 0.969657, 
	0.970031, 0.970403, 0.970772, 0.971139, 0.971504, 0.971866, 0.972226, 0.972584, 0.972940, 0.973293, 0.973644, 0.973993, 0.974339, 0.974684, 0.975025, 0.975365, 
	0.975702, 0.976037, 0.976370, 0.976700, 0.977028, 0.977354, 0.977677, 0.977999, 0.978317, 0.978634, 0.978948, 0.979260, 0.979570, 0.979877, 0.980182, 0.980485, 
	0.980785, 0.981083, 0.981379, 0.981673, 0.981964, 0.982253, 0.982539, 0.982824, 0.983105, 0.983385, 0.983662, 0.983937, 0.984210, 0.984480, 0.984749, 0.985014, 
	0.985278, 0.985539, 0.985798, 0.986054, 0.986308, 0.986560, 0.986809, 0.987057, 0.987301, 0.987544, 0.987784, 0.988022, 0.988258, 0.988491, 0.988722, 0.988950, 
	0.989177, 0.989400, 0.989622, 0.989841, 0.990058, 0.990273, 0.990485, 0.990695, 0.990903, 0.991108, 0.991311, 0.991511, 0.991710, 0.991906, 0.992099, 0.992291, 
	0.992480, 0.992666, 0.992850, 0.993032, 0.993212, 0.993389, 0.993564, 0.993737, 0.993907, 0.994075, 0.994240, 0.994404, 0.994565, 0.994723, 0.994879, 0.995033, 
	0.995185, 0.995334, 0.995481, 0.995625, 0.995767, 0.995907, 0.996045, 0.996180, 0.996313, 0.996443, 0.996571, 0.996697, 0.996820, 0.996941, 0.997060, 0.997176, 
	0.997290, 0.997402, 0.997511, 0.997618, 0.997723, 0.997825, 0.997925, 0.998023, 0.998118, 0.998211, 0.998302, 0.998390, 0.998476, 0.998559, 0.998640, 0.998719, 
	0.998795, 0.998870, 0.998941, 0.999011, 0.999078, 0.999142, 0.999205, 0.999265, 0.999322, 0.999378, 0.999431, 0.999481, 0.999529, 0.999575, 0.999619, 0.999660, 
	0.999699, 0.999735, 0.999769, 0.999801, 0.999831, 0.999858, 0.999882, 0.999905, 0.999925, 0.999942, 0.999958, 0.999971, 0.999981, 0.999989, 0.999995, 0.999999, 
};

static const float tan_vals[] = {
	0.000000, 0.001534, 0.003068, 0.004602, 0.006136, 0.007670, 0.009204, 0.010738, 0.012272, 0.013807, 0.015341, 0.016875, 0.018410, 0.019944, 0.021479, 0.023014, 
	0.024549, 0.026084, 0.027619, 0.029154, 0.030689, 0.032225, 0.033760, 0.035296, 0.036832, 0.038368, 0.039905, 0.041441, 0.042978, 0.044515, 0.046052, 0.047589, 
	0.049127, 0.050665, 0.052203, 0.053741, 0.055280, 0.056818, 0.058357, 0.059897, 0.061436, 0.062976, 0.064516, 0.066057, 0.067598, 0.069139, 0.070680, 0.072222, 
	0.073764, 0.075307, 0.076850, 0.078393, 0.079937, 0.081481, 0.083025, 0.084570, 0.086115, 0.087660, 0.089206, 0.090753, 0.092300, 0.093847, 0.095395, 0.096943, 
	0.098491, 0.100040, 0.101590, 0.103140, 0.104691, 0.106242, 0.107793, 0.109345, 0.110898, 0.112451, 0.114005, 0.115559, 0.117114, 0.118669, 0.120225, 0.121781, 
	0.123338, 0.124896, 0.126454, 0.128013, 0.129572, 0.131132, 0.132693, 0.134254, 0.135816, 0.137379, 0.138942, 0.140506, 0.142071, 0.143636, 0.145202, 0.146769, 
	0.148336, 0.149904, 0.151473, 0.153042, 0.154613, 0.156184, 0.157756, 0.159328, 0.160901, 0.162475, 0.164050, 0.165626, 0.167202, 0.168780, 0.170358, 0.171937, 
	0.173516, 0.175097, 0.176678, 0.178261, 0.179844, 0.181428, 0.183013, 0.184599, 0.186185, 0.187773, 0.189362, 0.190951, 0.192541, 0.194133, 0.195725, 0.197318, 
	0.198912, 0.200508, 0.202104, 0.203701, 0.205299, 0.206898, 0.208498, 0.210099, 0.211702, 0.213305, 0.214909, 0.216515, 0.218121, 0.219728, 0.221337, 0.222947, 
	0.224558, 0.226169, 0.227782, 0.229397, 0.231012, 0.232628, 0.234246, 0.235865, 0.237484, 0.239106, 0.240728, 0.242351, 0.243976, 0.245602, 0.247229, 0.248857, 
	0.250487, 0.252118, 0.253750, 0.255383, 0.257018, 0.258654, 0.260291, 0.261930, 0.263570, 0.265211, 0.266853, 0.268497, 0.270143, 0.271789, 0.273437, 0.275087, 
	0.276737, 0.278389, 0.280043, 0.281698, 0.283354, 0.285012, 0.286672, 0.288332, 0.289995, 0.291658, 0.293324, 0.294990, 0.296659, 0.298328, 0.300000, 0.301672, 
	0.303347, 0.305023, 0.306700, 0.308379, 0.310060, 0.311742, 0.313426, 0.315111, 0.316799, 0.318487, 0.320178, 0.321870, 0.323563, 0.325259, 0.326956, 0.328655, 
	0.330355, 0.332058, 0.333762, 0.335467, 0.337175, 0.338884, 0.340595, 0.342308, 0.344023, 0.345739, 0.347457, 0.349177, 0.350899, 0.352623, 0.354349, 0.356076, 
	0.357806, 0.359537, 0.361270, 0.363005, 0.364743, 0.366482, 0.368223, 0.369965, 0.371710, 0.373457, 0.375206, 0.376957, 0.378710, 0.380465, 0.382222, 0.383981, 
	0.385743, 0.387506, 0.389271, 0.391039, 0.392808, 0.394580, 0.396354, 0.398130, 0.399908, 0.401689, 0.403471, 0.405256, 0.407043, 0.408832, 0.410624, 0.412418, 
	0.414214, 0.416012, 0.417812, 0.419615, 0.421421, 0.423228, 0.425038, 0.426850, 0.428665, 0.430482, 0.432302, 0.434123, 0.435948, 0.437775, 0.439604, 0.441435, 
	0.443270, 0.445106, 0.446945, 0.448787, 0.450631, 0.452478, 0.454327, 0.456179, 0.458034, 0.459891, 0.461751, 0.463613, 0.465478, 0.467346, 0.469216, 0.471089, 
	0.472965, 0.474843, 0.476724, 0.478608, 0.480495, 0.482385, 0.484277, 0.486172, 0.488070, 0.489971, 0.491875, 0.493781, 0.495691, 0.497603, 0.499518, 0.501437, 
	0.503358, 0.505282, 0.507209, 0.509139, 0.511072, 0.513008, 0.514948, 0.516890, 0.518835, 0.520784, 0.522735, 0.524690, 0.526648, 0.528609, 0.530573, 0.532541, 
	0.534511, 0.536485, 0.538462, 0.540442, 0.542426, 0.544413, 0.546403, 0.548397, 0.550394, 0.552394, 0.554398, 0.556405, 0.558416, 0.560430, 0.562448, 0.564469, 
	0.566493, 0.568521, 0.570553, 0.572588, 0.574626, 0.576669, 0.578715, 0.580764, 0.582817, 0.584874, 0.586935, 0.588999, 0.591067, 0.593139, 0.595214, 0.597294, 
	0.599377, 0.601464, 0.603555, 0.605649, 0.607748, 0.609851, 0.611957, 0.614068, 0.616182, 0.618300, 0.620423, 0.622549, 0.624680, 0.626814, 0.628953, 0.631096, 
	0.633243, 0.635394, 0.637550, 0.639709, 0.641873, 0.644041, 0.646214, 0.648390, 0.650571, 0.652757, 0.654947, 0.657141, 0.659339, 0.661542, 0.663750, 0.665962, 
	0.668179, 0.670400, 0.672625, 0.674856, 0.677091, 0.679330, 0.681574, 0.683823, 0.686077, 0.688335, 0.690599, 0.692867, 0.695139, 0.697417, 0.699700, 0.701987, 
	0.704279, 0.706577, 0.708879, 0.711186, 0.713499, 0.715816, 0.718139, 0.720466, 0.722799, 0.725137, 0.727480, 0.729829, 0.732183, 0.734542, 0.736906, 0.739276, 
	0.741651, 0.744031, 0.746417, 0.748808, 0.751205, 0.753607, 0.756015, 0.758429, 0.760848, 0.763273, 0.765703, 0.768140, 0.770582, 0.773029, 0.775483, 0.777942, 
	0.780408, 0.782879, 0.785356, 0.787839, 0.790328, 0.792823, 0.795325, 0.797832, 0.800345, 0.802865, 0.805391, 0.807923, 0.810462, 0.813006, 0.815557, 0.818115, 
	0.820679, 0.823249, 0.825826, 0.828409, 0.830999, 0.833596, 0.836199, 0.838809, 0.841426, 0.844049, 0.846680, 0.849317, 0.851961, 0.854611, 0.857269, 0.859934, 
	0.862606, 0.865285, 0.867971, 0.870664, 0.873365, 0.876072, 0.878787, 0.881510, 0.884239, 0.886976, 0.889721, 0.892473, 0.895232, 0.898000, 0.900774, 0.903557, 
	0.906347, 0.909145, 0.911951, 0.914765, 0.917586, 0.920416, 0.923253, 0.926099, 0.928952, 0.931814, 0.934684, 0.937563, 0.940449, 0.943344, 0.946247, 0.949159, 
	0.952079, 0.955008, 0.957945, 0.960891, 0.963846, 0.966809, 0.969782, 0.972763, 0.975753, 0.978752, 0.981760, 0.984777, 0.987803, 0.990838, 0.993883, 0.996937, 
	1.000000, 1.003073, 1.006155, 1.009247, 1.012348, 1.015459, 1.018579, 1.021710, 1.024850, 1.028000, 1.031160, 1.034330, 1.037510, 1.040701, 1.043901, 1.047112, 
	1.050333, 1.053564, 1.056806, 1.060059, 1.063322, 1.066596, 1.069880, 1.073175, 1.076481, 1.079798, 1.083126, 1.086466, 1.089816, 1.093177, 1.096550, 1.099934, 
	1.103330, 1.106737, 1.110156, 1.113586, 1.117028, 1.120482, 1.123948, 1.127426, 1.130916, 1.134418, 1.137932, 1.141458, 1.144997, 1.148548, 1.152112, 1.155689, 
	1.159278, 1.162880, 1.166495, 1.170122, 1.173763, 1.177417, 1.181084, 1.184765, 1.188459, 1.192166, 1.195887, 1.199622, 1.203370, 1.207133, 1.210909, 1.214699, 
	1.218504, 1.222322, 1.226155, 1.230003, 1.233865, 1.237741, 1.241633, 1.245539, 1.249460, 1.253397, 1.257348, 1.261315, 1.265297, 1.269295, 1.273308, 1.277337, 
	1.281382, 1.285442, 1.289519, 1.293612, 1.297721, 1.301847, 1.305989, 1.310147, 1.314323, 1.318515, 1.322724, 1.326951, 1.331194, 1.335455, 1.339734, 1.344030, 
	1.348344, 1.352676, 1.357025, 1.361393, 1.365780, 1.370184, 1.374607, 1.379049, 1.383510, 1.387990, 1.392488, 1.397007, 1.401544, 1.406101, 1.410678, 1.415274, 
	1.419891, 1.424528, 1.429185, 1.433862, 1.438560, 1.443279, 1.448019, 1.452780, 1.457562, 1.462366, 1.467191, 1.472038, 1.476907, 1.481798, 1.486711, 1.491647, 
	1.496606, 1.501587, 1.506591, 1.511619, 1.516670, 1.521744, 1.526842, 1.531964, 1.537110, 1.542281, 1.547476, 1.552696, 1.557940, 1.563210, 1.568505, 1.573826, 
	1.579173, 1.584545, 1.589944, 1.595369, 1.600820, 1.606299, 1.611804, 1.617337, 1.622897, 1.628485, 1.634101, 1.639746, 1.645419, 1.651120, 1.656850, 1.662610, 
	1.668399, 1.674218, 1.680067, 1.685946, 1.691855, 1.697795, 1.703767, 1.709769, 1.715803, 1.721869, 1.727967, 1.734098, 1.740261, 1.746457, 1.752687, 1.758950, 
	1.765247, 1.771578, 1.777944, 1.784344, 1.790780, 1.797251, 1.803758, 1.810301, 1.816880, 1.823496, 1.830150, 1.836840, 1.843569, 1.850336, 1.857141, 1.863985, 
	1.870868, 1.877791, 1.884754, 1.891758, 1.898802, 1.905887, 1.913014, 1.920183, 1.927394, 1.934648, 1.941945, 1.949286, 1.956671, 1.964100, 1.971574, 1.979094, 
	1.986659, 1.994270, 2.001929, 2.009634, 2.017387, 2.025188, 2.033038, 2.040937, 2.048886, 2.056884, 2.064934, 2.073034, 2.081186, 2.089390, 2.097648, 2.105958, 
	2.114322, 2.122741, 2.131215, 2.139744, 2.148330, 2.156972, 2.165672, 2.174429, 2.183246, 2.192121, 2.201056, 2.210052, 2.219110, 2.228229, 2.237410, 2.246655, 
	2.255964, 2.265337, 2.274776, 2.284281, 2.293853, 2.303492, 2.313200, 2.322977, 2.332823, 2.342741, 2.352730, 2.362791, 2.372926, 2.383135, 2.393418, 2.403778, 
	2.414214, 2.424727, 2.435319, 2.445991, 2.456743, 2.467576, 2.478492, 2.489491, 2.500574, 2.511743, 2.522998, 2.534340, 2.545771, 2.557292, 2.568903, 2.580606, 
	2.592403, 2.604293, 2.616279, 2.628361, 2.640542, 2.652821, 2.665201, 2.677682, 2.690266, 2.702955, 2.715749, 2.728650, 2.741660, 2.754780, 2.768011, 2.781355, 
	2.794813, 2.808387, 2.822078, 2.835889, 2.849820, 2.863874, 2.878052, 2.892355, 2.906786, 2.921346, 2.936037, 2.950861, 2.965820, 2.980916, 2.996150, 3.011525, 
	3.027043, 3.042706, 3.058515, 3.074474, 3.090584, 3.106847, 3.123266, 3.139843, 3.156580, 3.173481, 3.190547, 3.207780, 3.225184, 3.242761, 3.260514, 3.278446, 
	3.296558, 3.314855, 3.333339, 3.352012, 3.370879, 3.389942, 3.409204, 3.428669, 3.448340, 3.468220, 3.488312, 3.508621, 3.529149, 3.549901, 3.570880, 3.592090, 
	3.613536, 3.635220, 3.657148, 3.679323, 3.701749, 3.724432, 3.747376, 3.770585, 3.794063, 3.817817, 3.841851, 3.866169, 3.890778, 3.915682, 3.940888, 3.966400, 
	3.992224, 4.018366, 4.044833, 4.071630, 4.098764, 4.126242, 4.154069, 4.182254, 4.210802, 4.239722, 4.269020, 4.298704, 4.328783, 4.359264, 4.390155, 4.421465, 
	4.453202, 4.485376, 4.517996, 4.551072, 4.584612, 4.618628, 4.653128, 4.688125, 4.723629, 4.759652, 4.796204, 4.833298, 4.870946, 4.909161, 4.947956, 4.987344, 
	5.027339, 5.067957, 5.109211, 5.151116, 5.193689, 5.236946, 5.280904, 5.325579, 5.370990, 5.417156, 5.464096, 5.511829, 5.560376, 5.609759, 5.659999, 5.711119, 
	5.763142, 5.816093, 5.869998, 5.924883, 5.980774, 6.037700, 6.095691, 6.154776, 6.214988, 6.276359, 6.338923, 6.402715, 6.467773, 6.534135, 6.601841, 6.670933, 
	6.741452, 6.813446, 6.886961, 6.962045, 7.038750, 7.117130, 7.197240, 7.279139, 7.362888, 7.448550, 7.536192, 7.625884, 7.717699, 7.811714, 7.908010, 8.006671, 
	8.107786, 8.211447, 8.317753, 8.426807, 8.538718, 8.653599, 8.771570, 8.892760, 9.017302, 9.145338, 9.277017, 9.412499, 9.551949, 9.695547, 9.843482, 9.995952, 
	10.153170, 10.315364, 10.482773, 10.655654, 10.834280, 11.018945, 11.209959, 11.407658, 11.612399, 11.824566, 12.044573, 12.272862, 12.509912, 12.756238, 13.012397, 13.278990, 
	13.556669, 13.846143, 14.148181, 14.463620, 14.793373, 15.138440, 15.499915, 15.878997, 16.277008, 16.695403, 17.135793, 17.599959, 18.089884, 18.607776, 19.156101, 19.737628, 
	20.355468, 21.013135, 21.714613, 22.464433, 23.267776, 24.130587, 25.059729, 26.063161, 27.150171, 28.331658, 29.620507, 31.032054, 32.584705, 34.300739, 36.207387, 38.338286, 
	40.735484, 43.452240, 46.557030, 50.139402, 54.318751, 59.257889, 65.184751, 72.428581, 81.483240, 93.124799, 108.646707, 130.377173, 162.972616, 217.298015, 325.948301, 651.898136, 
};
